Ejemplo n.º 1
0
        public static ProceduralSword NewSword(Mod mod, Vector2 position, SwordHilt hilt, SwordBlade blade, SwordAccent accent, float dps, int enemyDef)
        {
            if (hilt == null)
            {
                kRPG.LogMessage("Ummm....  Why is the hilt null?");
            }
            if (blade == null)
            {
                kRPG.LogMessage("Ummm....  Why is the blade null?");
            }

            int             id    = Item.NewItem(position, mod.GetItem("ProceduralSword").item.type);
            ProceduralSword sword = (ProceduralSword)Main.item[id].modItem;

            sword.Hilt     = hilt;
            sword.Blade    = blade;
            sword.Accent   = accent;
            sword.Dps      = dps;
            sword.EnemyDef = enemyDef;
            sword.Initialize();

            SwordInitPacket.Write(id, blade.Type, hilt.Type, accent.Type, dps, enemyDef);

            return(sword);
        }
Ejemplo n.º 2
0
        public static Item GenerateSword(Mod mod, Vector2 position, SwordTheme theme, float dps, int enemyDef)
        {
            ProceduralSword sword = NewSword(mod, position, SwordHilt.RandomHilt(theme), SwordBlade.RandomBlade(theme), Main.rand.Next(5) < 3 ? SwordAccent.RandomAccent() : SwordAccent.None, dps, enemyDef);

            return(sword.item);
        }
Ejemplo n.º 3
0
        public static void Initialize()
        {
            Hilts        = new Dictionary <int, SwordHilt>();
            HiltsByTheme = new Dictionary <SwordTheme, List <SwordHilt> >();

            Ceremonial       = new SwordHilt("CeremonialHilt", 6, 2, "Ceremonial ", 1f, 1.1f);
            CopperCrossguard = new SwordHilt("CopperCrossHilt", 6, 2, "Crude ", 1.05f, 0.95f, 0f, 0, false, false, 0, 0.1f);
            GoldenKatana     = new SwordHilt("GoldenKatanaHilt", 6, 1, "Traditional ", 0.96f, 1.1f, 0f, 5);
            BlackKatana      = new SwordHilt("KatanaHilt", 6, 1, "Forged ", 1f, 1.1f, 1.5f, 7, false, true, 1);
            Wooden           = new SwordHilt("WoodenHilt", 6, 2, "Training ", 1f, 0.9f, 1f);
            IronBasket       = new SwordHilt("IronBasketHilt", 6, 2, "Folded ", 1.02f, 0.85f, 0.5f, -1);
            Lead             = new SwordHilt("LeadHilt", 6, 4, "Blacksmithed ", 0.94f, 1.06f, -0.5f, 5);
            WoodenMount      = new SwordHilt("WoodenMount", 21, 2, "Partisan ", 0.9f, 0.8f, 1f, -1, true).DefineSpear("WoodenMount", 33, 2);
            CeremonialMount  = new SwordHilt("CeremonialMount", 19, 2, "Mounted ", 0.95f, 1f, 1f, 3, true).DefineSpear("CeremonialMount", 35, 2);
            Eyes             = new SwordHilt("EyesHilt", 7, 3, "Vile ", 1f, 1f);
            Coe                 = new SwordHilt("CrownOfEyesHilt", 8, 4, "Corrupted ", 1.04f, 0.9f, 1f, -1);
            DemoniteBat         = new SwordHilt("DemoniteBatHilt", 6, 4, "Shadowforged ", 1f, 1.1f, 0.4f, 1);
            BoneMount           = new SwordHilt("BoneMount", 20, 2, "Partisan ", 0.8f, 0.9f, 0.5f, 0, true).DefineSpear("BoneMount", 29, 2);
            BoneCrest           = new SwordHilt("BoneCrest", 9, 2, "Crested ", 1f, 1.1f, 0.4f, 0, false, true);
            DemonEye            = new SwordHilt("DemonEyeHilt", 7, 3, "Demonforged ", 1f, 1f, 1f, 3);
            VioletCrossguard    = new SwordHilt("VioletRunicCrossHilt", 8, 5, "Runic ", 1f, 1f, 0.3f);
            PurpleCrossguard    = new SwordHilt("PurpleRunicCrossHilt", 8, 4, "Arcane ", 1.25f, 1.1f, 1f, 4, false, false, 4);
            GoldenRunicKatana   = new SwordHilt("GoldenRunicKatanaHilt", 10, 1, "Runeforged ", 1.1f, 1.1f, 3);
            VioletRunicKatana   = new SwordHilt("VioletRunicKatanaHilt", 10, 1, "Glyphic ", 1.05f, 1f, 1f);
            ArcaneMount         = new SwordHilt("ArcaneMount", 19, 3, "Mounted ", 0.9f, 1f, 0.4f, 2, true, false, 3).DefineSpear("ArcaneMount", 33, 3);
            Stick               = new SwordHilt("StickHilt", 6, 0, "Primitive ", 1f, 0.9f, 1f);
            HellstoneBasket     = new SwordHilt("HellstoneBasketHilt", 9, 2, "Brutish ", 1f, 0.9f, 1f, 0, false, false, 0, 0.1f);
            HellstoneCrossguard = new SwordHilt("HellstoneCrossHilt", 7, 4, "Hellforged ", 1f, 1f, 0.5f, 4, false, false, 0, 0.05f);
            Torch               = new SwordHilt("TorchHilt", 9, 4, "Underworldly ", 0.92f, 1.1f, 0, 10);
            HellstoneMount      = new SwordHilt("HellstoneMount", 21, 2, "Mounted ", 0.9f, 1.05f, 2, 0, true).DefineSpear("HellstoneMount", 32, 2);
            Bone                = new SwordHilt("BoneHilt", 9, 3, "Skeletal ", 1.1f, 0.8f, 0f, 0, false, false, 0, 0.05f);
            Clock               = new SwordHilt("ClockHilt", 13, 6, "Clockwork ", 0.96f, 1.1f, 0, 0, false, true).SetAccentOffset(new Point(1, 2));
            Carbon              = new SwordHilt("CarbonHilt", 11, 6, "High-tech ", 1.05f, 1f, 1f, 6, false, false, 2);
            Thorns              = new SwordHilt("ThornHilt", 6, 7, "Thorny ", 1.1f, 0.8f, 1f);
            ChlorophyteMount    = new SwordHilt("ChlorophyteMount", 19, 4, "Mounted ", 0.9f, 0.9f, 1f, 0, true).DefineSpear("ChlorophyteMount", 35, 4);
            OminousHilt         = new SwordHilt("OminousHilt", 8, 6, "Ominous ", 1f, 0.9f, 2f, 2, false, true, 2, 0.08f);

            HiltsByTheme = new Dictionary <SwordTheme, List <SwordHilt> >
            {
                {
                    SwordTheme.Generic, new List <SwordHilt>
                    {
                        Ceremonial,
                        CopperCrossguard,
                        GoldenKatana,
                        BlackKatana,
                        Wooden,
                        Lead,
                        WoodenMount,
                        CeremonialMount,
                        DemoniteBat,
                        Stick
                    }
                },
                {
                    SwordTheme.Monstrous, new List <SwordHilt>
                    {
                        Eyes,
                        Coe,
                        BoneMount,
                        BoneCrest,
                        DemonEye
                    }
                },
                {
                    SwordTheme.Runic, new List <SwordHilt>
                    {
                        PurpleCrossguard,
                        VioletCrossguard,
                        GoldenRunicKatana,
                        VioletRunicKatana,
                        ArcaneMount
                    }
                },
                {
                    SwordTheme.Hellish, new List <SwordHilt>
                    {
                        HellstoneBasket,
                        HellstoneCrossguard,
                        Torch,
                        HellstoneMount,
                        Bone,
                        BoneMount
                    }
                },
                {
                    SwordTheme.Hardmode, new List <SwordHilt>
                    {
                        Clock,
                        Carbon,
                        Thorns,
                        ChlorophyteMount,
                        OminousHilt
                    }
                }
            };
        }