public void AddWeapons(IReadOnlyCollection <RangedWeapon> rangedWeapons, IReadOnlyCollection <MeleeWeapon> meleeWeapons) { if (rangedWeapons?.Count > 0) { RangedWeapons.AddRange(rangedWeapons); } if (meleeWeapons?.Count > 0) { MeleeWeapons.AddRange(meleeWeapons); } if (RangedWeapons.Count > 0) { if (RangedWeapons.Count == 1) { EquippedRangedWeapons.AddRange(RangedWeapons); } else if (RangedWeapons[0].Template.Location == EquipLocation.OneHand && RangedWeapons[1].Template.Location == EquipLocation.OneHand) { EquippedRangedWeapons.Add(RangedWeapons[0]); EquippedRangedWeapons.Add(RangedWeapons[1]); } else { EquippedRangedWeapons.Add(RangedWeapons[0]); } } if (MeleeWeapons.Count > 0) { if (EquippedRangedWeapons.Count == 0) { // we have two hands free for close combat weapons if (MeleeWeapons.Count == 1) { EquippedMeleeWeapons.AddRange(MeleeWeapons); } else if (MeleeWeapons[0].Template.Location == EquipLocation.OneHand && MeleeWeapons[1].Template.Location == EquipLocation.OneHand) { EquippedMeleeWeapons.Add(MeleeWeapons[0]); EquippedMeleeWeapons.Add(MeleeWeapons[1]); } else { EquippedMeleeWeapons.Add(MeleeWeapons[0]); } } else if (EquippedRangedWeapons.Count == 1 && EquippedRangedWeapons[0].Template.Location == EquipLocation.OneHand) { if (MeleeWeapons[0].Template.Location == EquipLocation.OneHand) { EquippedMeleeWeapons.Add(MeleeWeapons[0]); } else if (MeleeWeapons.Count > 1 && MeleeWeapons[1].Template.Location == EquipLocation.OneHand) { EquippedMeleeWeapons.Add(MeleeWeapons[1]); } } } }
public static string GetDescription(MeleeWeapons weapon) { switch (weapon) { case MeleeWeapons.Sword: return Locale.Resource.MenuSwordDesc; case MeleeWeapons.MayaHammer: return Locale.Resource.MenuHammerDesc; case MeleeWeapons.Spear: return Locale.Resource.MenuSpearDesc; default: throw new ArgumentException(); } }
public static string GetDescription(MeleeWeapons weapon) { switch (weapon) { case MeleeWeapons.Sword: return(Locale.Resource.MenuSwordDesc); case MeleeWeapons.MayaHammer: return(Locale.Resource.MenuHammerDesc); case MeleeWeapons.Spear: return(Locale.Resource.MenuSpearDesc); default: throw new ArgumentException(); } }
public void ChangeMeleeWeapon(MeleeWeapons weaponType, GameObject gameObject) { iMeleeWeapon?.Destroy(); switch (weaponType) { case MeleeWeapons.Punch: iMeleeWeapon = gameObject.AddComponent <Punch>(); break; case MeleeWeapons.Knife: break; case MeleeWeapons.Katana: break; default: throw new ArgumentOutOfRangeException(nameof(weaponType), weaponType, null); } }
public StartScreenControl() { Size = new Vector2(600, 420); LargeWindow = true; objectives.Dock = System.Windows.Forms.DockStyle.Left; objectives.Size = new Vector2(300, 0); options.AddChild(weaponsControl); weaponsControl.AddChild(new Label { Text = Locale.Resource.MapSelectedWeapons, Size = new Vector2(0, 30), TextAnchor = global::Graphics.Orientation.TopLeft, Dock = System.Windows.Forms.DockStyle.Top, Font = new Font { SystemFont = Fonts.LargeSystemFont, Color = System.Drawing.Color.Gold }, Background = null, Clickable = false }); weaponsControl.AddChild(meleeWeaponsContainer); weaponsControl.AddChild(rangedWeaponsContainer); var meleeWeapons = Enum.GetValues(typeof(MeleeWeapons)); for (int i = 1; i < meleeWeapons.Length; i++) { MeleeWeapons wp = (MeleeWeapons)meleeWeapons.GetValue(i); var w = new Checkbox { Text = "", Background = null, UnCheckedGraphic = new ImageGraphic { Texture = new TextureFromFile("Interface/Common/" + WeaponsInfo.GetIconBaseName(wp) + "GameIconOff1.png") { DontScale = true }, SizeMode = SizeMode.AutoAdjust, Position = new Vector3(-12, -11, 0) }, CheckedGraphic = new ImageGraphic { Texture = new TextureFromFile("Interface/Common/" + WeaponsInfo.GetIconBaseName(wp) + "GameIconOn1.png") { DontScale = true }, SizeMode = SizeMode.AutoAdjust, Position = new Vector3(-12, -11, 0) }, UnCheckedHoverGraphic = new ImageGraphic { Texture = new TextureFromFile("Interface/Common/" + WeaponsInfo.GetIconBaseName(wp) + "GameIconSelected1.png") { DontScale = true }, SizeMode = SizeMode.AutoAdjust, Position = new Vector3(-12, -11, 0) }, Size = new Vector2(100, 25), Margin = new System.Windows.Forms.Padding(5) }; Program.Instance.Tooltip.SetToolTip(w, Util.GetLocaleResourceString(wp) + "\n\n" + WeaponsInfo.GetDescription(wp)); w.Click += new EventHandler((e, o) => { SelectedMeleeWeapon = wp; }); meleeWeaponsContainer.AddChild(w); meleeCheckboxes.Add(wp, w); } var bullets = Enum.GetValues(typeof(RangedWeapons)); for (int i = 1; i < bullets.Length; i++) { RangedWeapons wp = (RangedWeapons)bullets.GetValue(i); if (wp == RangedWeapons.Fire) { continue; } var w = new Checkbox { Text = "", Background = null, UnCheckedGraphic = new ImageGraphic { Texture = new TextureFromFile("Interface/Common/" + WeaponsInfo.GetIconBaseName(wp) + "GameIconOff1.png") { DontScale = true }, SizeMode = SizeMode.AutoAdjust, Position = new Vector3(-12, -11, 0) }, CheckedGraphic = new ImageGraphic { Texture = new TextureFromFile("Interface/Common/" + WeaponsInfo.GetIconBaseName(wp) + "GameIconOn1.png") { DontScale = true }, SizeMode = SizeMode.AutoAdjust, Position = new Vector3(-12, -11, 0) }, UnCheckedHoverGraphic = new ImageGraphic { Texture = new TextureFromFile("Interface/Common/" + WeaponsInfo.GetIconBaseName(wp) + "GameIconSelected1.png") { DontScale = true }, SizeMode = SizeMode.AutoAdjust, Position = new Vector3(-12, -11, 0) }, Size = new Vector2(100, 25), Margin = new System.Windows.Forms.Padding(5) }; Program.Instance.Tooltip.SetToolTip(w, Util.GetLocaleResourceString(wp) + "\n\n" + WeaponsInfo.GetDescription(wp)); w.Click += new EventHandler((e, o) => { SelectedRangedWeapon = wp; }); rangedWeaponsContainer.AddChild(w); bulletCheckboxes.Add(wp, w); } //innerControl.AddChild(new Control //{ // Background = new StretchingImageGraphic // { // Texture = new TextureConcretizer // { // TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 255, 255)) // }, // SizeMode = SizeMode.AutoAdjust, // }, // Dock = System.Windows.Forms.DockStyle.Left, // Size = new Vector2(1, 1) //}); innerControl.AddChild(options); bottomBar.AddChild(startButton); startButton.Click += new EventHandler(startButton_Click); bottomBar.AddChild(quitButton); quitButton.Click += new EventHandler(quitButton_Click); ButtonBase optionsButton = new StoneButton { Anchor = Graphics.Orientation.Left, Position = new Vector2(20 + quitButton.Size.X, 0), Text = Locale.Resource.GenOptions }; optionsButton.Click += new EventHandler(optionsButton_Click); bottomBar.AddChild(optionsButton); }
public static string GetIconBaseName(MeleeWeapons weapon) { return weapon.ToString(); }
public void AddItem(WorldObject wo, bool logStats) { // Weapon Properties double missileDefMod = 0.00f; double magicDefMod = 0.00f; double wield = 0.00f; int value = 0; TotalItems++; // Loop depending on how many items you are creating for (int i = 0; i < 1; i++) { var testItem = wo; if (testItem == null) { NullCount++; continue; } switch (testItem.ItemType) { case ItemType.None: break; case ItemType.MeleeWeapon: MeleeWeaponCount++; bool cantrip = false; if (testItem.EpicCantrips.Count > 0) { cantrip = true; } if (testItem.LegendaryCantrips.Count > 0) { cantrip = true; } string strikeType = "N"; if (testItem.WeaponMagicDefense != null) { magicDefMod = testItem.WeaponMagicDefense.Value; } if (testItem.Value != null) { value = testItem.Value.Value; } if (testItem.WeaponMissileDefense != null) { missileDefMod = testItem.WeaponMissileDefense.Value; } if (testItem.WieldDifficulty != null) { wield = testItem.WieldDifficulty.Value; } if (testItem.WeaponSkill == Skill.TwoHandedCombat) { if (logStats) { MeleeWeapons.Add($"{testItem.WeaponSkill},{wield},{testItem.Damage.Value},{strikeType},{testItem.DamageVariance.Value},{testItem.WeaponDefense.Value},{magicDefMod},{missileDefMod},{cantrip},{value},{testItem.EncumbranceVal},{testItem.Name}"); } else { MeleeWeapons.Add($"{testItem.WeaponSkill}\t {wield}\t {testItem.Damage.Value}\t\t {strikeType} \t\t {testItem.DamageVariance.Value}\t\t {testItem.WeaponDefense.Value}\t\t {magicDefMod}\t\t {missileDefMod}\t\t {cantrip}\t{value}\t{testItem.EncumbranceVal} \t {testItem.Name}"); } } else { if ((testItem.W_AttackType & AttackType.TripleStrike) != 0) { strikeType = "3x"; } else if ((testItem.W_AttackType & AttackType.DoubleStrike) != 0) { strikeType = "2x"; } if (logStats) { MeleeWeapons.Add($"{testItem.WeaponSkill},{wield},{testItem.Damage.Value},{strikeType},{testItem.DamageVariance.Value},{testItem.WeaponDefense.Value},{magicDefMod},{missileDefMod},{cantrip},{value},{testItem.EncumbranceVal},{testItem.Name}"); } else { MeleeWeapons.Add($" {testItem.WeaponSkill}\t\t {wield}\t {testItem.Damage.Value}\t\t {strikeType}\t\t {testItem.DamageVariance.Value}\t\t {testItem.WeaponDefense.Value}\t\t {magicDefMod}\t\t {missileDefMod}\t\t {cantrip}\t{value}\t{testItem.EncumbranceVal} \t {testItem.Name}"); } } break; case ItemType.Armor: ArmorCount++; string equipmentSet = "None "; cantrip = false; // float cantripSpells = 0; var epicCantripSpells = testItem.EpicCantrips.Keys; if (testItem.EpicCantrips.Count > 0) { cantrip = true; } if (testItem.LegendaryCantrips.Count > 0) { cantrip = true; } if (testItem.EquipmentSetId != null) { equipmentSet = testItem.EquipmentSetId.ToString(); } if (logStats) { Armor.Add($"{testItem.ArmorLevel},{testItem.ItemDifficulty},{testItem.Value.Value},{testItem.EncumbranceVal},{testItem.EpicCantrips.Count},{testItem.LegendaryCantrips.Count},{equipmentSet},{testItem.Name}"); } else { Armor.Add($" {testItem.ArmorLevel}\t{testItem.ItemDifficulty}\t{testItem.Value.Value}\t{testItem.EncumbranceVal}\t{testItem.EpicCantrips.Count}\t{testItem.LegendaryCantrips.Count}\t{equipmentSet}\t\t\t{testItem.Name}"); } if (testItem.Name.Contains("Sheild")) // typo? { break; } if (testItem.ArmorLevel > MaxAL) { MaxAL = testItem.ArmorLevel.Value; MaxALItem = testItem.Name; } if (testItem.ArmorLevel < MinAL) { MinAL = testItem.ArmorLevel.Value; MinALItem = testItem.Name; } break; case ItemType.Clothing: if (testItem.Name.Contains("Cloak")) { string cloakSet = "None "; if (testItem.EquipmentSetId != null) { cloakSet = testItem.EquipmentSetId.ToString(); } CloakCount++; if (logStats) { Cloaks.Add($"{testItem.ItemMaxLevel},{testItem.WieldDifficulty},{testItem.CloakWeaveProc.Value},{testItem.Value.Value},{cloakSet}"); } else { Cloaks.Add($" {testItem.ItemMaxLevel}\t {testItem.WieldDifficulty}\t {testItem.CloakWeaveProc.Value}\t {testItem.Value.Value}\t {cloakSet}"); } } else { ClothingCount++; } break; case ItemType.Jewelry: JewelryCount++; string jewelrySlot = ""; switch (testItem.ValidLocations) { case EquipMask.NeckWear: JewelryNecklaceCount++; jewelrySlot = "Neck"; break; case EquipMask.WristWear: JewelryBraceletCount++; jewelrySlot = "Brace"; break; case EquipMask.FingerWear: JewelryRingCount++; jewelrySlot = "Ring"; break; case EquipMask.TrinketOne: JewelryTrinketCount++; jewelrySlot = "Trink"; break; default: // Console.WriteLine(testItem.Name); break; } if (logStats) { Jewelry.Add($"{jewelrySlot},{testItem.ItemDifficulty},{testItem.Value}"); } else { Jewelry.Add($" {jewelrySlot}\t {testItem.ItemDifficulty}\t {testItem.Value}"); } break; case ItemType.Creature: break; case ItemType.Food: Food++; break; case ItemType.Money: break; case ItemType.Misc: string spirit = "Spirit"; string potionA = "Philtre"; string potionB = "Elixir"; string potionC = "Tonic"; string potionD = "Brew"; string potionE = "Potion"; string potionF = "Draught"; string potionG = "Tincture"; string healingKits = "Kit"; string spellcompGlyph = "Glyph"; string spellcompInk = "Ink"; string spellcompQuill = "Quill"; if (testItem.Name.Contains(spirit)) { Spirits++; } else if (testItem is PetDevice petDevice) { PetsCount++; int totalRatings = 0; int damage = 0; int damageResist = 0; int crit = 0; int critDamage = 0; int critDamageResist = 0; int critResist = 0; int petLevel = 0; if (petDevice.UseRequiresSkillLevel == 570) { petLevel = 200; } else if (petDevice.UseRequiresSkillLevel == 530) { petLevel = 180; } else if (petDevice.UseRequiresSkillLevel == 475) { petLevel = 150; } else if (petDevice.UseRequiresSkillLevel == 430) { petLevel = 125; } else if (petDevice.UseRequiresSkillLevel == 400) { petLevel = 100; } else if (petDevice.UseRequiresSkillLevel == 370) { petLevel = 80; } else if (petDevice.UseRequiresSkillLevel == 310) { petLevel = 50; } if (petDevice.GearDamage != null) { totalRatings += petDevice.GearDamage.Value; damage = petDevice.GearDamage.Value; } if (petDevice.GearDamageResist != null) { totalRatings += petDevice.GearDamageResist.Value; damageResist = petDevice.GearDamageResist.Value; } if (petDevice.GearCrit != null) { totalRatings += petDevice.GearCrit.Value; crit = petDevice.GearCrit.Value; } if (petDevice.GearCritDamage != null) { totalRatings += petDevice.GearCritDamage.Value; critDamage = petDevice.GearCritDamage.Value; } if (petDevice.GearCritDamageResist != null) { totalRatings += petDevice.GearCritDamageResist.Value; critDamageResist = petDevice.GearCritDamageResist.Value; } if (petDevice.GearCritResist != null) { totalRatings += petDevice.GearCritResist.Value; critResist = petDevice.GearCritResist.Value; } if (logStats) { Pets.Add($"{petLevel},{damage},{damageResist},{crit},{critDamage},{critDamageResist},{critResist},{totalRatings}"); } else { Pets.Add($" {petLevel}\t {damage}\t {damageResist}\t {crit}\t {critDamage}\t {critDamageResist}\t {critResist}\t {totalRatings}"); } if (totalRatings > 99) { PetRatingsOverHundred++; } else if (totalRatings > 89) { PetRatingsOverNinety++; } else if (totalRatings > 79) { PetRatingsOverEighty++; } else if (totalRatings > 69) { PetRatingsOverSeventy++; } else if (totalRatings > 59) { PetRatingsOverSixty++; } else if (totalRatings > 49) { PetRatingsOverFifty++; } else if (totalRatings > 39) { PetRatingsOverForty++; } else if (totalRatings > 29) { PetRatingsOverThirty++; } else if (totalRatings > 19) { PetRatingsOverTwenty++; } else if (totalRatings > 9) { PetRatingsOverTen++; } else if (totalRatings > 0) { PetRatingsEqualOne++; } else if (totalRatings < 1) { PetRatingsEqualZero++; } } else if (testItem.Name.Contains(potionA) || testItem.Name.Contains(potionB) || testItem.Name.Contains(potionC) || testItem.Name.Contains(potionD) || testItem.Name.Contains(potionE) || testItem.Name.Contains(potionF) || testItem.Name.Contains(potionG)) { Potions++; } else if (testItem.Name.Contains(spellcompGlyph) || testItem.Name.Contains(spellcompInk) || testItem.Name.Contains(spellcompQuill)) { LevelEightComp++; } else if (testItem.Name.Contains(healingKits)) { HealingKit++; } else { // Console.WriteLine($"ItemType.Misc Name={testItem.Name}"); Misc++; } break; case ItemType.MissileWeapon: double eleBonus = 0.00f; double damageMod = 0.00f; string missileType = "Other"; if (testItem.AmmoType != null) { switch (testItem.AmmoType.Value) { case AmmoType.None: break; case AmmoType.Arrow: missileType = "Bow"; MissileWeaponCount++; break; case AmmoType.Bolt: missileType = "X Bow"; MissileWeaponCount++; break; case AmmoType.Atlatl: missileType = "Thrown"; MissileWeaponCount++; break; case AmmoType.ArrowCrystal: break; case AmmoType.BoltCrystal: break; case AmmoType.AtlatlCrystal: break; case AmmoType.ArrowChorizite: break; case AmmoType.BoltChorizite: break; case AmmoType.AtlatlChorizite: break; default: break; } } if (testItem.WeaponMagicDefense != null) { magicDefMod = testItem.WeaponMagicDefense.Value; } if (testItem.Value != null) { value = testItem.Value.Value; } if (testItem.WeaponMissileDefense != null) { missileDefMod = testItem.WeaponMissileDefense.Value; } if (testItem.WieldDifficulty != null) { wield = testItem.WieldDifficulty.Value; } if (testItem.ElementalDamageBonus != null) { eleBonus = testItem.ElementalDamageBonus.Value; } if (testItem.DamageMod != null) { damageMod = testItem.DamageMod.Value; } if (missileType == "Other") { DinnerWare++; } else { if (logStats) { MissileWeapons.Add($"{missileType},{wield},{damageMod},{eleBonus},{testItem.WeaponDefense.Value},{magicDefMod},{missileDefMod},{value},{testItem.EncumbranceVal}"); } else { MissileWeapons.Add($"{missileType}\t {wield}\t {damageMod}\t\t{eleBonus}\t\t {testItem.WeaponDefense.Value}\t\t {magicDefMod}\t\t {missileDefMod}\t\t {value}\t {testItem.EncumbranceVal}"); } } break; case ItemType.Container: break; case ItemType.Useless: // Console.WriteLine($"ItemType.Useless Name={testItem.Name}"); break; case ItemType.Gem: string aetheriaColor = "None"; if (Server.Entity.Aetheria.IsAetheria(testItem.WeenieClassId)) { AetheriaCount++; if (testItem.WieldDifficulty == 75) { aetheriaColor = "Blue "; } else if (testItem.WieldDifficulty == 150) { aetheriaColor = "Yellow"; } else if (testItem.WieldDifficulty == 225) { aetheriaColor = "Red "; } if (logStats) { Aetheria.Add($"{aetheriaColor},{testItem.ItemMaxLevel}"); } else { Aetheria.Add($" {aetheriaColor}\t {testItem.ItemMaxLevel}"); } } else { GemCount++; } break; case ItemType.SpellComponents: SpellComponents++; break; case ItemType.Writable: string scrolls = "Scroll"; if (testItem.Name.Contains(scrolls)) { Scrolls++; } else { Console.WriteLine($"ItemType.Writeable Name={testItem.Name}"); } break; case ItemType.Key: Key++; break; case ItemType.Caster: CasterCount++; double eleMod = 0.00f; if (testItem.WeaponMagicDefense != null) { magicDefMod = testItem.WeaponMagicDefense.Value; } if (testItem.Value != null) { value = testItem.Value.Value; } if (testItem.WeaponMissileDefense != null) { missileDefMod = testItem.WeaponMissileDefense.Value; } if (testItem.WieldDifficulty != null) { wield = testItem.WieldDifficulty.Value; } if (testItem.ElementalDamageMod != null) { eleMod = testItem.ElementalDamageMod.Value; } if (testItem.ItemMaxMana != null) { ItemMaxMana = testItem.ItemMaxMana.Value; } if (logStats) { CasterWeapons.Add($"{wield},{eleMod},{testItem.WeaponDefense.Value},{magicDefMod},{missileDefMod},{value},{testItem.EncumbranceVal},{ItemMaxMana}"); } else { CasterWeapons.Add($" {wield}\t {eleMod}\t\t {testItem.WeaponDefense.Value}\t\t {magicDefMod}\t\t {missileDefMod}\t\t {value}\t {testItem.EncumbranceVal} \t {ItemMaxMana}"); } break; case ItemType.Portal: break; case ItemType.Lockable: break; case ItemType.PromissoryNote: break; case ItemType.ManaStone: ManaStone++; break; case ItemType.Service: break; case ItemType.MagicWieldable: break; case ItemType.CraftCookingBase: OtherCount++; break; case ItemType.CraftAlchemyBase: OtherCount++; break; case ItemType.CraftFletchingBase: OtherCount++; break; case ItemType.CraftAlchemyIntermediate: OtherCount++; break; case ItemType.CraftFletchingIntermediate: OtherCount++; break; case ItemType.LifeStone: break; case ItemType.TinkeringTool: OtherCount++; break; case ItemType.TinkeringMaterial: OtherCount++; break; case ItemType.Gameboard: break; case ItemType.PortalMagicTarget: break; case ItemType.LockableMagicTarget: break; case ItemType.Vestements: break; case ItemType.Weapon: break; case ItemType.WeaponOrCaster: break; case ItemType.Item: Console.WriteLine($"ItemType.item Name={testItem.Name}"); break; case ItemType.RedirectableItemEnchantmentTarget: break; case ItemType.ItemEnchantableTarget: break; case ItemType.VendorShopKeep: break; case ItemType.VendorGrocer: break; default: OtherCount++; break; } /*switch (testItem.ItemType) * { * case ItemType.Armor: * break; * case ItemType.MeleeWeapon: * break; * case ItemType.Caster: * break; * case ItemType.MissileWeapon: * break; * case ItemType.Jewelry: * break; * case ItemType.Gem: * break; * case ItemType.Clothing: * break; * default: * break; * }*/ if (testItem.ItemMaxMana != null) { if (testItem.ItemMaxMana > MaxMana) { MaxMana = testItem.ItemMaxMana.Value; } if (testItem.ItemMaxMana < MinMana) { MinMana = testItem.ItemMaxMana.Value; } HasManaCount++; TotalMaxMana += testItem.ItemMaxMana.Value; } if (testItem.Name == null) { Console.WriteLine("*Name is Null*"); continue; } if (testItem.EpicCantrips.Count > 0) { EpicCantripCount++; } if (testItem.LegendaryCantrips.Count > 0) { LegendaryCantripCount++; } } }
private void RemoveMeleeWeapon(MeleeWeapon item) { MeleeWeapons.Remove(item); RemoveWeaponCombination(item.Guid); }
private void AddMeleeWeapon(MeleeWeapon item) { MeleeWeapons.Add(item); OwnedWeaponCombinations.Add(new WeaponCombinationHolder(item.Name, item.Guid, null)); }
public static string GetIconBaseName(MeleeWeapons weapon) { return(weapon.ToString()); }
public void WeponCraft(MeleeWeapons Wepon) { GameObject.FindGameObjectWithTag("Inventory").GetComponent <CraftingV2>().CraftNonPlaceable(Wepon); }
public BaseWeaponsController(MeleeWeapons melee, RangeWeaponType range, GameObject gameObject, AimManager playerAim) { aimManager = playerAim; ChangeWeapon(range, gameObject); ChangeMeleeWeapon(melee, gameObject); }
public void CraftNonPlaceable(MeleeWeapons obj) { bool[] collectedReources; bool allowSubtract = false; collectedReources = new bool[obj.recpie.requiredResources.Length]; if (Bag.Count == 0) { Debug.Log("Your Inventory is empty"); } else { for (int i = 0; i < Bag.Count; i++) { for (int j = 0; j < obj.recpie.requiredResources.Length; j++) { if (Bag[i].item.typeOfResource == obj.recpie.requiredResources[j].requiredResource.typeOfResource) { if (Bag[i].amount >= obj.recpie.requiredResources[j].requiredAmount) { collectedReources[j] = true; } else { collectedReources[j] = false; } } } } for (int i = 0; i < Bag.Count; i++) { for (int j = 0; j < obj.recpie.requiredResources.Length; j++) { if (Bag[i].item.typeOfResource == obj.recpie.requiredResources[j].requiredResource.typeOfResource) { if (Bag[i].amount >= obj.recpie.requiredResources[j].requiredAmount) { for (int k = 0; k < collectedReources.Length; k++) { if (collectedReources[k] != true) { break; } if (k == collectedReources.Length - 1 && collectedReources[k] == true) { allowSubtract = true; } } } } } } for (int i = 0; i < Bag.Count; i++) { for (int j = 0; j < obj.recpie.requiredResources.Length; j++) { if (Bag[i].item.typeOfResource == obj.recpie.requiredResources[j].requiredResource.typeOfResource) { if (Bag[i].amount >= obj.recpie.requiredResources[j].requiredAmount) { for (int k = 0; k < collectedReources.Length; k++) { if (allowSubtract == true) { Bag[i].amount -= obj.recpie.requiredResources[j].requiredAmount; } } } } } } for (int i = 0; i < collectedReources.Length; i++) { if (collectedReources[i] == false) { break; } if (i == collectedReources.Length - 1 && collectedReources[i] == true) { player.GetComponent <Melee>().weaponHolding = obj; } } } player.transform.GetComponent <PlayerStats>().InventoryStatus = false; }