Пример #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);
        }
Пример #2
0
        public override ModItem Clone(Item tItem)
        {
            ProceduralSword copy = (ProceduralSword)base.Clone(tItem);

            copy.Hilt      = Hilt;
            copy.Blade     = Blade;
            copy.Accent    = Accent;
            copy.Dps       = Dps;
            copy.EnemyDef  = EnemyDef;
            copy.Spear     = Spear;
            copy.EleDamage = new Dictionary <Element, float>();
            foreach (Element element in Enum.GetValues(typeof(Element)))
            {
                copy.EleDamage[element] = EleDamage[element];
            }
            copy.item.SetNameOverride(tItem.Name);
            return(copy);
        }
Пример #3
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);
        }