public Armor(IStatsInfo stats, ItemRarity rarity, ArmorMaterial material, ArmorType type) { this.Stats = stats; this.Rarity = rarity; this.Material = material; this.Type = type; }
public static float getDestructibility(ArmorMaterial material) { switch (material) { case ArmorMaterial.Aramid: return(0.25f); case ArmorMaterial.Combined: return(0.5f); case ArmorMaterial.UHMWPE: return(0.45f); case ArmorMaterial.Titan: return(0.55f); case ArmorMaterial.Aluminium: return(0.6f); case ArmorMaterial.Steel: return(0.7f); case ArmorMaterial.Ceramic: return(0.8f); case ArmorMaterial.Glass: return(0.8f); default: return(0); } }
public ItemArmor(int par1, ArmorMaterial par2EnumArmorMaterial, int par3, int par4) : base(par1) { Material = par2EnumArmorMaterial; ArmorType = par4; RenderIndex = par3; DamageReduceAmount = par2EnumArmorMaterial.GetDamageReductionAmount(par4); SetMaxDamage(par2EnumArmorMaterial.GetDurability(par4)); MaxStackSize = 1; }
public Armor() { CoveredRegions = new List <Body.BodyRegions>(); //empty we don't cover anything CurrentDurability = 0; MaximumDurability = 0; //hopefully this doesn't break anything, spoilers lol Material = ArmorMaterial.Glass; //need to have *a* material ArmorClass = 0; BluntThroughput = 1; Resistance = 1; Name = "Nothing"; }
//Helmet public Armor(String name, int armorClass, int Durability, ArmorMaterial material, float blunt = 1) { CoveredRegions = new List <Body.BodyRegions>(); CoveredRegions.Add(Body.BodyRegions.Head); CurrentDurability = Durability; MaximumDurability = Durability; Material = material; ArmorClass = armorClass; Resistance = armorClass * 10; BluntThroughput = blunt; Name = name; }
public static void BuildSoundMenuBar() { // Ghetto-ness warning Main.WinForm.Invoke(new Action(() => { //Main.TAE_EDITOR.MenuBar.AddTopItem("Sound"); Main.TAE_EDITOR.MenuBar.ClearItem("Sound"); if (!(GameDataManager.GameType == GameDataManager.GameTypes.DS1 || GameDataManager.GameType == GameDataManager.GameTypes.DS1R || GameDataManager.GameType == GameDataManager.GameTypes.DS3 || GameDataManager.GameType == GameDataManager.GameTypes.SDT)) { return; } Main.TAE_EDITOR.MenuBar.AddItem("Sound", "[STOP ALL]", () => { StopAllSounds(); }); Main.TAE_EDITOR.MenuBar.AddSeparator("Sound"); Main.TAE_EDITOR.MenuBar.AddItem("Sound", "Player Armor Material", new Dictionary <string, Action> { { nameof(ArmorMaterialType.Plates), () => ArmorMaterial = ArmorMaterialType.Plates }, { nameof(ArmorMaterialType.Chains), () => ArmorMaterial = ArmorMaterialType.Chains }, { nameof(ArmorMaterialType.Cloth), () => ArmorMaterial = ArmorMaterialType.Cloth }, { nameof(ArmorMaterialType.None), () => ArmorMaterial = ArmorMaterialType.None }, }, () => ArmorMaterial.ToString()); Dictionary <string, Action> floorMatMenuItems = new Dictionary <string, Action>(); foreach (var kvp in FloorMaterialNames) { floorMatMenuItems.Add($"{kvp.Key:D2}: {kvp.Value}", () => { FloorMaterial = kvp.Key; }); } Main.TAE_EDITOR.MenuBar.AddItem(@"Sound", "Floor Material", floorMatMenuItems, () => $"{FloorMaterial:D2}: {FloorMaterialNames[FloorMaterial]}"); })); }
//Body Armor public Armor(String name, int armorClass, int Durability, ArmorMaterial material, Boolean Stomach, Boolean Arms = false, float blunt = 1) { CoveredRegions = new List <Body.BodyRegions>(); CoveredRegions.Add(Body.BodyRegions.Thorax);//everybody covers this one if (Stomach) { CoveredRegions.Add(Body.BodyRegions.Stomach); } if (Arms) { CoveredRegions.Add(Body.BodyRegions.LArm); CoveredRegions.Add(Body.BodyRegions.RArm);//Both arms } CurrentDurability = Durability; MaximumDurability = Durability; Material = material; ArmorClass = armorClass; Resistance = armorClass * 10; BluntThroughput = blunt; Name = name; }
public Item( KindOfItem newKindOfItem, KindOfArmory newKindOfArmory, Classes newItemClass) { this.itemClass = newItemClass; this.kindOfItem = newKindOfItem; this.kindOfArmory = newKindOfArmory; this.itemLevel = 1; if (itemClass.CharacterClass.Equals(new Classes(Classes.Class.Warrior).CharacterClass) || itemClass.CharacterClass.Equals(new Classes(Classes.Class.Paladin).CharacterClass) || itemClass.CharacterClass.Equals(new Classes(Classes.Class.DeathKnight).CharacterClass)) { this.armorMaterial = ArmorMaterial.Plate; this.itemValue = 200; } else if (itemClass.CharacterClass.Equals(new Classes(Classes.Class.Hunter).CharacterClass) || itemClass.CharacterClass.Equals(new Classes(Classes.Class.Druid).CharacterClass) || itemClass.CharacterClass.Equals(new Classes(Classes.Class.Shaman).CharacterClass)) { this.armorMaterial = ArmorMaterial.Mail; this.itemValue = 80; } else if (itemClass.CharacterClass.Equals(new Classes(Classes.Class.Monk).CharacterClass) || itemClass.CharacterClass.Equals(new Classes(Classes.Class.DemonHunter).CharacterClass) || itemClass.CharacterClass.Equals(new Classes(Classes.Class.Rouge).CharacterClass)) { this.armorMaterial = ArmorMaterial.Leather; this.itemValue = 60; } else if (itemClass.CharacterClass.Equals(new Classes(Classes.Class.Mage).CharacterClass) || itemClass.CharacterClass.Equals(new Classes(Classes.Class.Warlock).CharacterClass) || itemClass.CharacterClass.Equals(new Classes(Classes.Class.Priest).CharacterClass)) { this.armorMaterial = ArmorMaterial.Cloth; this.itemValue = 40; } }
protected override Material ParseModelFromJavaField(string line) { System.Globalization.CultureInfo invariancy = System.Globalization.CultureInfo.InvariantCulture; int startIndex = 0; int endIndex = line.IndexOf(" ", startIndex); string type = line.Substring(startIndex, endIndex - startIndex); startIndex = endIndex + 1; endIndex = line.IndexOf(" ", startIndex); string name = line.Substring(startIndex, endIndex - startIndex); Material material = null; if (type == "ToolMaterial") { material = new ToolMaterial() { Name = name }; ToolMaterial toolMaterial = (ToolMaterial)material; startIndex = line.IndexOf(",", endIndex) + 1; endIndex = line.IndexOf(",", startIndex); string harvestLevel = line.Substring(startIndex, endIndex - startIndex); toolMaterial.HarvestLevel = int.Parse(harvestLevel, invariancy); startIndex = line.IndexOf(",", endIndex) + 1; endIndex = line.IndexOf(",", startIndex); string maxUses = line.Substring(startIndex, endIndex - startIndex); toolMaterial.MaxUses = int.Parse(maxUses, invariancy); startIndex = line.IndexOf(",", endIndex) + 1; endIndex = line.IndexOf(",", startIndex); string efficiency = line.Substring(startIndex, endIndex - startIndex); toolMaterial.Efficiency = float.Parse(efficiency, invariancy); startIndex = line.IndexOf(",", endIndex) + 1; endIndex = line.IndexOf(",", startIndex); string damage = line.Substring(startIndex, endIndex - startIndex); toolMaterial.AttackDamage = float.Parse(damage, invariancy); startIndex = line.IndexOf(",", endIndex) + 1; endIndex = line.IndexOf(",", startIndex); string enchantability = line.Substring(startIndex, endIndex - startIndex); toolMaterial.Enchantability = int.Parse(enchantability, invariancy); } else if (type == "ArmorMaterial") { material = new ArmorMaterial() { Name = name }; ArmorMaterial armorMaterial = (ArmorMaterial)material; startIndex = line.IndexOf(",", endIndex) + 1; endIndex = line.IndexOf(",", startIndex); string textureName = line.Substring(startIndex, endIndex - startIndex); armorMaterial.TextureName = textureName; startIndex = line.IndexOf(",", endIndex) + 1; endIndex = line.IndexOf(",", startIndex); string durability = line.Substring(startIndex, endIndex - startIndex); armorMaterial.Durability = int.Parse(durability, invariancy); startIndex = line.IndexOf("{", endIndex) + 1; endIndex = line.IndexOf("}", startIndex); string reductionAmounts = line.Substring(startIndex, endIndex - startIndex).Trim(); armorMaterial.HelmetDamageReduction = (int)char.GetNumericValue(reductionAmounts, 0); armorMaterial.PlateDamageReduction = (int)char.GetNumericValue(reductionAmounts, 2); armorMaterial.LegsDamageReduction = (int)char.GetNumericValue(reductionAmounts, 4); armorMaterial.BootsDamageReduction = (int)char.GetNumericValue(reductionAmounts, 6); startIndex = line.IndexOf(",", endIndex) + 1; endIndex = line.IndexOf(",", startIndex); string enchantability = line.Substring(startIndex, endIndex - startIndex); armorMaterial.Enchantability = int.Parse(enchantability, invariancy); startIndex = line.IndexOf(",", endIndex) + 1; endIndex = line.IndexOf(",", startIndex); string soundOnEquip = line.Substring(startIndex, endIndex - startIndex); armorMaterial.SoundEvent = soundOnEquip; startIndex = line.IndexOf(",", endIndex) + 1; endIndex = line.IndexOf(",", startIndex); string toughness = line.Substring(startIndex, endIndex - startIndex); armorMaterial.Toughness = float.Parse(toughness, invariancy); } else if (type == "Material") { material = new BlockMaterial() { Name = name }; BlockMaterial blockMaterial = (BlockMaterial)material; startIndex = line.IndexOf("(", endIndex) + 1; endIndex = line.IndexOf(")", startIndex); string solid = line.Substring(startIndex, endIndex - startIndex); blockMaterial.IsSolid = bool.Parse(solid); startIndex = line.IndexOf("(", endIndex) + 1; endIndex = line.IndexOf(")", startIndex); string liquid = line.Substring(startIndex, endIndex - startIndex); blockMaterial.IsLiquid = bool.Parse(liquid); startIndex = line.IndexOf("(", endIndex) + 1; endIndex = line.IndexOf(")", startIndex); string blockLight = line.Substring(startIndex, endIndex - startIndex); blockMaterial.BlocksLight = bool.Parse(blockLight); startIndex = line.IndexOf("(", endIndex) + 1; endIndex = line.IndexOf(")", startIndex); string blockMovement = line.Substring(startIndex, endIndex - startIndex); blockMaterial.BlocksMovement = bool.Parse(blockMovement); startIndex = line.IndexOf("(", endIndex) + 1; endIndex = line.IndexOf(")", startIndex); string translucent = line.Substring(startIndex, endIndex - startIndex); blockMaterial.IsTranslucent = bool.Parse(translucent); startIndex = line.IndexOf("(", endIndex) + 1; endIndex = line.IndexOf(")", startIndex); string requiresNoTool = line.Substring(startIndex, endIndex - startIndex); blockMaterial.RequiresNoTool = bool.Parse(requiresNoTool); startIndex = line.IndexOf("(", endIndex) + 1; endIndex = line.IndexOf(")", startIndex); string burning = line.Substring(startIndex, endIndex - startIndex); blockMaterial.CanBurn = bool.Parse(burning); startIndex = line.IndexOf("(", endIndex) + 1; endIndex = line.IndexOf(")", startIndex); string replaceable = line.Substring(startIndex, endIndex - startIndex); blockMaterial.IsReplaceable = bool.Parse(replaceable); startIndex = line.IndexOf("(", endIndex) + 1; endIndex = line.IndexOf(")", startIndex); string adventureModeExempt = line.Substring(startIndex, endIndex - startIndex); blockMaterial.IsAdventureModeExempt = bool.Parse(adventureModeExempt); startIndex = line.IndexOf("(", endIndex) + 1; endIndex = line.IndexOf(")", startIndex); string mobilityFlag = line.Substring(startIndex, endIndex - startIndex); blockMaterial.MobilityFlag = (PushReaction)System.Enum.Parse(typeof(PushReaction), mobilityFlag.Remove(0, "EnumPushReaction.".Length), true); } else { throw new System.NotImplementedException($"Implementation of {type} was not found"); } material.IsDirty = false; return(material); }